import axios from 'axios'
export default {
  namespaced:true,
  state: {
    isGetRoute: false
  },
  mutations: {
    finishGetRoute(state) {
      state.isGetRoute = true
    },
    needGetRoute(state) {
      state.isGetRoute = false
    }
  },
  actions: {
    getRoute({ commit }) {
      return axios({
        method: 'get',
        url: '/resource/authorityMenu',
      }).then(res=>{
        if (res.data.success) {
          commit('finishGetRoute')
          return res.data.result
        } else {
          return []
        }
      })
    }
  },
  namespaced: true
}